import requests

from pet_frame.api.pet_hospital import PetHospital


class Owner(PetHospital):

    def adds(self, data):
        add_url = f"https://petstore.swagger.io/v2/pet"
        req = {
            "method": "POST",
            "url": add_url,
            "json": data
        }
        r = self.send_method(req)
        return r


    def update(self, data):
        update_url = f"https://petstore.swagger.io/v2/pet"
        req = {
            "method": "PUT",
            "url": update_url,
            "json": data
        }
        r = self.send_method(req)
        return r

    def get(self, id):
        get_url = f"https://petstore.swagger.io/v2/pet/{id}"
        req = {
            "method": "GET",
            "url": get_url
        }
        r = self.send_method(req)
        return r

    def get_status(self, status):
        get_status = f"https://petstore.swagger.io/v2/pet/findByStatus"
        req = {
            "method": "GET",
            "url": get_status,
            "params": status
        }
        r = self.send_method(req)
        return r

    def delete(self, id):
        delete_url = f"https://petstore.swagger.io/v2/pet/{id}"
        req = {
            "method": "DELETE",
            "url": delete_url,
        }
        r = self.send_method(req)
        return r

    def update_id(self, id, data):
        update_id_url = f"https://petstore.swagger.io/v2/pet/{id}"
        req = {
            "method": "POST",
            "url": update_id_url,
            "params": data
        }
        # r = requests.request("get", data=data)
        r = self.send_method(req)
        return r




